Circular dependencies occur when two classes reference each other, either directly or indirectly. This means that the classes' dependency structure
does not represent an intuitive hierarchy, which makes it harder to understand and maintain.
Compared to S7027, this issue is even more significant when a cycle crosses package boundaries because:
- It disrupts the dependency hierarchy or layer structure even between packages.
- It spreads the problem across more distant locations in the source code.
What is the potential impact?
Circular dependencies increase the architectural complexity of the code, reducing its readability, extensibility, and maintainability. As the
project grows, circular dependencies often lead to more circular dependencies, further complication of the architecture and increasing technical debt.
Over time, untangling these dependencies becomes increasingly difficult.